$(()=>{

    // console.log(oldPassword1);

    if (error){
        layer.msg(error)
    }

    if (success){
        layer.msg("请重新登录");
        setTimeout(function (){
            location.href = "user/logout";
            parent.location.reload();
        },1000);

    }
    //确认按钮添加事件
    $("#confirm").click(function (e){
        e.preventDefault();

        //前端校验
        let oldPassword = $("#oldPassword").val();
        let newPassword = $("#newPassword").val();
        let newPassword1 = $("#newPassword1").val();
        console.log(oldPassword1)
        if (oldPassword!==oldPassword1){
            layer.msg("密码输入错误");
        }else if (newPassword === oldPassword1){
            layer.msg("新密码不允许与旧密码一致");
        }else if (newPassword !== newPassword1){
            layer.msg("两次输入的密码不正确");
        }else{
            layer.confirm("是否确认修改",function (){
                $("#passwordForm").submit();
            })

        }

    })

})